<?php
namespace Home\Controller;
use Think\Controller;
class FormController extends Controller{

	public function index(){

		$db = M('Form');
		$result = $db->select();

		$this->assing('list',$result);
		$this->display();
	}

	public function add(){
		$this->display();
	}

	public function insert(){
		$db = M('Form');

		$data['title'] = I('post.title');
		$data['content'] = I('post.content');
		$data['create_time'] = time();
		$db->add($data);
	}

	public function del($id=0){
		$db = M('Data');
		$ret = $db->delete($id);
		if($ret===false){
			echo "error!";
		}else {
			echo"影响了：" . $ret;
		}
	}
	public function vcode(){

		$config =    array(
			'fontsize'    =>     30,
			'length'      =>     4,
			'useNoise'    =>     true,
			'useImgBg'    =>     true,
            //'useZh'       =>     true,
            //'fontttf'     =>     'STXINWEI.TTF',

		);
		$Verify = new \Think\Verify($config);
		$Verify->entry();
		 
	}
}